<?php
/**
 * Created by PhpStorm
 * User: 龍zero
 * Date: 2022-05-25
 * Time: 17:07
 */

namespace App\Lib\Tools;


use Hyperf\Paginator\LengthAwarePaginator;

class MyPaginator extends LengthAwarePaginator
{

    public function toArray(): array
    {
        return [
            'total' => $this->total(),
            'items' => $this->items->toArray(),
            'count' => $this->perPage(),
            'page' => $this->currentPage(),
            'total_page' => $this->lastPage(),
        ];
    }
}